angular.module('myApp').service('PeopleService', function($http) {
    this.name='p1';
    this.getAllPeople=function() {
      return $http.get('data/people.json');
    },
    
    this.getPerson=function(id) {
      function personMatchesParam(person) {
        return person.id === id;
      }
      
      return this.getAllPeople().then(function (people) {
        return people.find(personMatchesParam)
      });
    }


})